p2m: change_type_range: Only invalidate mapped gfns
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Sat, 22 Dec 2018 09:43:52 +0000 (09:43 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Sat, 22 Dec 2018 09:43:52 +0000 (09:43 +0000)
commit7f28661f6a7ce3d82f881b9afedfebca7f2cf116
tree716a85aeb79dbc366e0b10055f1566a49122b3d3
parentb5acd075aabc043cc7e9aa533ec697dd68a1d137
p2m: change_type_range: Only invalidate mapped gfns

change_type_range() invalidates gfn ranges to lazily change the type
of a range of gfns, and also modifies the logdirty rangesets of that
p2m. At the moment, it clips both down by the hostp2m.

While this will result in correct behavior, it's not entirely efficient,
since invalidated entries outside that range will, on fault, simply be
modified back to "empty" before faulting normally again.

Separate out the calculation of the two ranges. Keep using the
hostp2m's max_mapped_pfn to clip the logdirty ranges, but use the
current p2m's max_mapped_pfn to further clip the invalidation range
for alternate p2ms.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/p2m.c